import jQuery from "jquery";
import { useEffect } from "react";
import request from "../../framework/common/utils/request";
import "./index.css"

export default  function Service () {
  useEffect(() => {
    // let data={"code":1,"data":{"show":"1","url":"https://www.baidu.com","icon":""},"message":"","detailMessage":"","success":1}

    request({
      url: "/systemsettings/config-setting?conf_key=service_config",
      method: "get",
    }).then(
      function (data) {
        let service = data.data || {};
        if(service.show==="1" && service.url && service.icon ){
         
          jQuery("body").append(
            '<div id="RobotHandler" class="iyunwen_js_class">\
                    <a href="' +
              service.url +
              '" target="blank">\
                    <img src="' +
              service.icon +
              '" style="border:none; height: 100%; width: auto;">\
                </a>\
                </div>'
          );
        }
       
       
      },
      function (error) {
      
      }
    );
  }, []);

  return null;
}
